﻿using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace WEIShareSL
{
	public partial class ResultItemTemplate : UserControl
	{
		public double FullHeight;
		public double MiniHeight = 25;
		
		public ResultItemTemplate()
		{
			// Required to initialize variables
			InitializeComponent();
			
			myBorder.MouseLeftButtonUp +=new System.Windows.Input.MouseButtonEventHandler(myBorder_MouseLeftButtonUp);
			myBorder.LayoutUpdated +=new System.EventHandler(myBorder_LayoutUpdated);
		}

		private void myBorder_MouseLeftButtonUp(object sender, System.Windows.Input.MouseButtonEventArgs e)
		{
			if(this.Height!=MiniHeight)
			{
				this.Height = MiniHeight;
			}
			else
			{
				this.Height = FullHeight;
			}
		}

		private void myBorder_LayoutUpdated(object sender, System.EventArgs e)
		{
			if(FullHeight<MiniHeight)
			{
				FullHeight = this.ActualHeight;
				this.Height = MiniHeight;
			}
		}
	}
}